package common

import helpers.EnumLike

case class Environment(self: String) extends AnyVal with EnumLike.Value {

  def isCanProd: Boolean = this == Environment.Production

  def isExists: Boolean = in(Environment.values)
}

object Environment extends EnumLike.Definition[Environment] {

  val Venus      = Environment("venus")
  val Jupiter    = Environment("jupiter")
  val Production = Environment("production")
  val Unknown    = Environment("Unknown")

  override def values: Seq[Environment] = Seq(Venus, Jupiter, Production, Unknown)

  implicit override def self: EnumLike.Definition[Environment] = this

  def apply(): Environment = new Environment(System.getenv("RUNNING_MODE"))
}
